home *** CD-ROM | disk | FTP | other *** search
/ Aminet 12 / Aminet 12 (1996)(GTI - Schatztruhe)[!][Jun 1996].iso / Aminet / dev / e / framework.lha / fw / wbObject.e < prev    next >
Encoding:
Text File  |  1996-01-28  |  724 b   |  34 lines

  1.  
  2. -> wbObject is an abstraction of every Workbench GUI object.
  3.  
  4. -> Copyright © Guichard Damien 01/04/1996
  5.  
  6. OPT MODULE
  7. OPT EXPORT
  8.  
  9. MODULE 'fw/any'
  10.  
  11. CONST NUMSIGNALS=32  -> The maximum number of signals for a Task.
  12.  
  13. ENUM PASS, CONTINUE, STOPIT, STOPALL
  14.  
  15. OBJECT wbObject OF any
  16. ENDOBJECT
  17.  
  18. -> Implements a simple event loop which listens for the Exec Signal.
  19. PROC simpleLoop() OF wbObject
  20.   REPEAT
  21.     Wait(Shl(1,self.signal()))
  22.   UNTIL self.handleActivation() > CONTINUE
  23. ENDPROC
  24.  
  25. -> Perform the appropriate action when object is activated.
  26. PROC handleActivation() OF wbObject IS STOPALL
  27.  
  28. -> Exec signal associated with this WB object
  29. PROC signal() OF wbObject IS -1
  30.  
  31. -> Remove the WB object.
  32. PROC remove() OF wbObject IS EMPTY
  33.  
  34.